#include "stdafx.h"
#include "TerrainApp.h"
TerrainApp::TerrainApp(void)
{
}

TerrainApp::~TerrainApp(void)
{
}

void TerrainApp::createScene()
{
	m_pCam->setPosition(Ogre::Vector3(1683, 50, 2116));
	m_pCam->lookAt(Ogre::Vector3(1963, 50, 1660));

	Ogre::Vector3 lightdir(0.55, -0.3, 0.75);
	lightdir.normalise();

	Ogre::Light* light = m_pSceneMgr->createLight("tstLight");
	light->setType(Ogre::Light::LT_DIRECTIONAL);
	light->setDirection(lightdir);
	light->setDiffuseColour(Ogre::ColourValue::White);
	light->setSpecularColour(Ogre::ColourValue(0.4, 0.4, 0.4));

	m_pSceneMgr->setAmbientLight(Ogre::ColourValue(0.2, 0.2, 0.2));

	mTerrainGlobals = new Ogre::TerrainGlobalOptions();

	mTerrainGroup = new Ogre::TerrainGroup(m_pSceneMgr, Ogre::Terrain::ALIGN_X_Z,
		513, 12000.0f);
	mTerrainGroup->setFilenameConvention()
}

void TerrainApp::createFrameListener()
{
	m_pFrameListener = new TerrainAppFrameListener(mWindow);
	m_cameraMgr.setCamera(m_pCam);
	m_pFrameListener->setCameraManager(&m_cameraMgr);
	m_pUI = new TerrainAppUI;
	m_pFrameListener->setUIBase(m_pUI);
	mRoot->addFrameListener(m_pFrameListener);	
}